/**
 * Project Name:smcs-mass-dns-ipcheck
 * File Name:ConvertUtil.java
 * Package Name:com.surfilter.massdata.ipcheck.util
 * Date:2015-3-14下午04:36:39
 * Copyright (c) 2015, Shenzhen Surfilter Network Technology Co.,Ltd All Rights Reserved.
 * 
*/

package com.surfilter.massdata.spark.util;

import com.surfilter.massdata.spark.bean.IpBean;





/**
 * ClassName:ConvertUtil <br/>
 * Function: TODO ADD FUNCTION. <br/>
 * Reason:   TODO ADD REASON. <br/>
 * Date:     2015-3-14 下午04:36:39 <br/>
 * @author   sunkai
 * @version  
 * @since    JDK 1.7
 * @see      
 */
public class ConvertUtil {
	
	public static IpBean convertIpBean(String[] ipArr, IpBean ipBean){
		ipBean.setId(Long.valueOf(ipArr[0]));
		ipBean.setBbdw_id(Long.valueOf(ipArr[1]));
		if("null".equals(ipArr[2])){
			ipBean.setSbsj(-1l);
		}else{
			ipBean.setSbsj(Long.valueOf(ipArr[2]));
		}
		if("null".equals(ipArr[3])){
			ipBean.setIplx(-1);
		}else{
			ipBean.setIplx(Integer.valueOf(ipArr[3]));
		}
		ipBean.setQsip(Long.valueOf(ipArr[4]));
		ipBean.setZzip(Long.valueOf(ipArr[5]));
		if("null".equals(ipArr[6])){
			ipBean.setSfgn(-1l);
		}else{
			ipBean.setSfgn(Long.valueOf(ipArr[6]));
		}
		if("null".equals(ipArr[7])){
			ipBean.setFpfs(-1l);
		}else{
			ipBean.setFpfs(Long.valueOf(ipArr[7]));
		}
		if("null".equals(ipArr[8])){
			ipBean.setFpdx(-1l);
		}else{
			ipBean.setFpdx(Long.valueOf(ipArr[8]));
		}
		if("null".equals(ipArr[9])){
			ipBean.setSyfs(-1l);
		}else{
			ipBean.setSyfs(Long.valueOf(ipArr[9]));
		}
		if("null".equals(ipArr[10])){
			ipBean.setFprq(-1l);
		}else{
			ipBean.setFprq(Long.valueOf(ipArr[10]));
		}
		if("null".equals(ipArr[11])){
			ipBean.setYmtzfwq(-1);
		}else{
			ipBean.setYmtzfwq(Integer.valueOf(ipArr[11]));
		}
		if("null".equals(ipArr[12])){
			ipBean.setDwmc("N/A");
		}else{
			ipBean.setDwmc(ipArr[12]);
		}
		if("null".equals(ipArr[13])){
			ipBean.setDwxz(-1l);
		}else{
			ipBean.setDwxz(Long.valueOf(ipArr[13]));
		}
		if("null".equals(ipArr[14])){
			ipBean.setDwxzjb(-1l);
		}else{
			ipBean.setDwxzjb(Long.valueOf(ipArr[14]));
		}
		if("null".equals(ipArr[15])){
			ipBean.setDwfl(-1l);
		}else{
			ipBean.setDwfl(Long.valueOf(ipArr[15]));
		}
		if("null".equals(ipArr[16])){
			ipBean.setDwhyfl(-1l);
		}else{
			ipBean.setDwhyfl(Long.valueOf(ipArr[16]));
		}
		if("null".equals(ipArr[17])){
			ipBean.setJyxkzh("N/A");
		}else{
			ipBean.setJyxkzh(ipArr[17]);
			
		}
		if("null".equals(ipArr[18])){
			ipBean.setShengid(-1l);
		}else{
			ipBean.setShengid(Long.valueOf(ipArr[18]));
			
		}
		if("null".equals(ipArr[19])){
			ipBean.setShiid(-1l);
		}else{
			ipBean.setShiid(Long.valueOf(ipArr[19]));
			
		}
		if("null".equals(ipArr[20])){
			ipBean.setXianid(-1l);
		}else{
			ipBean.setXianid(Long.valueOf(ipArr[20]));
			
		}
		if("null".equals(ipArr[21])){
			ipBean.setXxdz("N/A");
		}else{
			ipBean.setXxdz(ipArr[21]);
			
		}
		if("null".equals(ipArr[22])){
			ipBean.setLxrxm("N/A");
		}else{
			ipBean.setLxrxm(ipArr[22]);
		}
		if("null".equals(ipArr[23])){
			ipBean.setLxrdh("N/A");
		}else{
			ipBean.setLxrdh(ipArr[23]);
		}
		if("null".equals(ipArr[24])){
			ipBean.setLxrdzyj("N/A");
		}else{
			ipBean.setLxrdzyj(ipArr[24]);
		}
		if("null".equals(ipArr[25])){
			ipBean.setWgip(-1l);
		}else{
			ipBean.setWgip(Long.valueOf(ipArr[25]));
		}
		if("null".equals(ipArr[26])){
			ipBean.setWgdz("N/A");
		}else{
			ipBean.setWgdz(ipArr[26]);
		}
		if("null".equals(ipArr[27])){
			ipBean.setBz("N/A");
		}else{
			ipBean.setBz(ipArr[27]);
		}
		if("null".equals(ipArr[28])){
			ipBean.setIpsss(-1l);
		}else{
			ipBean.setIpsss(Long.valueOf(ipArr[28]));
		}
		if("null".equals(ipArr[29])){
			ipBean.setJtiplx(-1);
		}else{
			ipBean.setJtiplx(Integer.valueOf(ipArr[29]));
		}
		if("null".equals(ipArr[30])){
			ipBean.setIpssjf("N/A");
		}else{
			ipBean.setIpssjf(ipArr[30]);
		}
		if("null".equals(ipArr[31])){
			ipBean.setLyid(-1l);
		}else{
			ipBean.setLyid(Long.valueOf(ipArr[31]));
		}
		if("null".equals(ipArr[32])){
			ipBean.setSourceIdcId("N/A");
		}else{
			ipBean.setSourceIdcId(ipArr[32]);
		}
		if("null".equals(ipArr[33])){
			ipBean.setReportIdcId("N/A");
		}else{
			ipBean.setReportIdcId(ipArr[33]);
		}
		if("null".equals(ipArr[34])){
			ipBean.setReportType(-1);
		}else{
			ipBean.setReportType(Integer.valueOf(ipArr[34]));
		}
		if("null".equals(ipArr[35])){
			ipBean.setLastModifyTime(new java.util.Date().getTime());
		}else{
			ipBean.setLastModifyTime(Long.valueOf(ipArr[35]));
		}
		if("null".equals(ipArr[36])){
			ipBean.setIsWarn(-1);
		}else{
			ipBean.setIsWarn(Integer.valueOf(ipArr[36]));
		}
		if("null".equals(ipArr[37])){
			ipBean.setStorageType("N/A");
		}else{
			ipBean.setStorageType(ipArr[37]);
		}
		if("null".equals(ipArr[38])){
			ipBean.setTflag("N/A");
		}else{
			ipBean.setTflag(ipArr[38]);
		}
		if("null".equals(ipArr[39])){
			ipBean.setIsPass(true);
		}else{
			ipBean.setIsPass(Boolean.valueOf(ipArr[39]));
		}
		if("null".equals(ipArr[40])){
			ipBean.setConflictType(-1);
		}else{
			ipBean.setConflictType(Integer.valueOf(ipArr[40]));
		}
		if("null".equals(ipArr[41])){
			ipBean.setHouseCode("N/A");
		}else{
			ipBean.setHouseCode(ipArr[41]);
		}
		if("null".equals(ipArr[42])){
			ipBean.setHouseName("N/A");
		}else{
			ipBean.setHouseName(ipArr[42]);
		}
		if("null".equals(ipArr[43])){
			ipBean.setOperatorsId("N/A");
		}else{
			ipBean.setOperatorsId(ipArr[43]);
		}
		if("null".equals(ipArr[44])){
			ipBean.setOperatorsName("N/A");
		}else{
			ipBean.setOperatorsName(ipArr[44]);
		}
		if("null".equals(ipArr[45])){
			ipBean.setOperatorsBh("N/A");
		}else{
			ipBean.setOperatorsBh(ipArr[45]);
		}
		if("null".equals(ipArr[46])){
			ipBean.setJtiplx(-1);
		}else{
			ipBean.setJtiplx(Integer.valueOf(ipArr[46]));
		}
		return ipBean;
	}
	
	public static IpBean copy(IpBean newIpBean, IpBean iterBean){
		newIpBean.setId(iterBean.getId());
		newIpBean.setBbdw_id(iterBean.getBbdw_id());
		newIpBean.setSbsj(iterBean.getSbsj());
		newIpBean.setIplx(iterBean.getIplx());
		newIpBean.setQsip(iterBean.getQsip());
		newIpBean.setZzip(iterBean.getZzip());
		newIpBean.setSfgn(iterBean.getSfgn());
		newIpBean.setFpfs(iterBean.getFpfs());
		newIpBean.setFpdx(iterBean.getFpdx());
		newIpBean.setSyfs(iterBean.getSyfs());
		newIpBean.setFprq(iterBean.getFprq());
		newIpBean.setYmtzfwq(iterBean.getYmtzfwq());
		newIpBean.setDwmc(iterBean.getDwmc());
		newIpBean.setDwxz(iterBean.getDwxz());
		newIpBean.setDwxzjb(iterBean.getDwxzjb());
		newIpBean.setDwfl(iterBean.getDwfl());
		newIpBean.setDwhyfl(iterBean.getDwhyfl());
		newIpBean.setJyxkzh(iterBean.getJyxkzh());
		newIpBean.setShengid(iterBean.getShengid());
		newIpBean.setShiid(iterBean.getShiid());
		newIpBean.setXianid(iterBean.getXianid());
		newIpBean.setXxdz(iterBean.getXxdz());
		newIpBean.setLxrxm(iterBean.getLxrxm());
		newIpBean.setLxrdh(iterBean.getLxrdh());
		newIpBean.setLxrdzyj(iterBean.getLxrdzyj());
		newIpBean.setWgip(iterBean.getWgip());
		newIpBean.setWgdz(iterBean.getWgdz());
		newIpBean.setBz(iterBean.getBz());
		newIpBean.setIpsss(iterBean.getIpsss());
		newIpBean.setJtiplx(iterBean.getJtiplx());
		newIpBean.setIpssjf(iterBean.getIpssjf());
		newIpBean.setLyid(iterBean.getLyid());
		newIpBean.setSourceIdcId("N/A");
		newIpBean.setReportIdcId(iterBean.getReportIdcId());
		newIpBean.setReportType(iterBean.getReportType());
		newIpBean.setLastModifyTime(iterBean.getLastModifyTime());
		newIpBean.setIsWarn(iterBean.getIsWarn());
		newIpBean.setStorageType(iterBean.getStorageType());
		newIpBean.setTflag(iterBean.getTflag());
		newIpBean.setIsPass(iterBean.getIsPass());
		newIpBean.setConflictType(iterBean.getConflictType());
		//newIpBean.setHouseCode("N/A");
		newIpBean.setHouseCode(iterBean.getHouseCode());
		newIpBean.setHouseName(iterBean.getHouseName());
		/*if("null".equals(iterBean.getHouseCode())){
		}else{
			newIpBean.setHouseCode(iterBean.getHouseCode());
		}*/
		newIpBean.setOperatorsId(iterBean.getOperatorsId());
		newIpBean.setOperatorsName(iterBean.getOperatorsName());
		newIpBean.setOperatorsBh(iterBean.getOperatorsBh());
		newIpBean.setJtiplx(iterBean.getJtiplx());
		return newIpBean;
		
	}
	
	
}
